﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace WPFHostDemoShell
{
    public class User32
    {
        public const uint SWP_SHOWWINDOW = 0x0040;
        public const uint WM_USER = 0x0400;
        public const uint WM_Normal = WM_USER + 1;
        public const uint WM_Minimal = WM_USER + 2;
        public const uint WM_Exit = WM_USER + 3;
        public const uint WM_Pos = WM_USER + 4;
        public const uint WM_Size = WM_USER + 5;
        public const uint WM_ShowInTaskBar = WM_USER + 6;

        public const int WM_MOVE = 0x0003;

        [DllImport("User32.dll")]
        public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);


        [DllImport("User32.dll")]
        public static extern uint SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);


        [DllImport("User32.dll")]
        public static extern int GetCursorPos(ref POINT point);

        [DllImport("User32.dll")]
        public static extern bool GetWindowRect(IntPtr hWnd, ref RECT lpRect);
    }

    public struct POINT
    {
        public int x;
        public int y;
    }

    public struct RECT
    {
        public int left;
        public int top;
        public int right;
        public int bottom;
    }
}
